#ifndef __CHILD_H__
#define __CHILD_H__ 

#include <time.h>
#include <sys/select.h>

typedef struct _child{
    pid_t           child_pid;      /* child process ID */
    int             child_pipefd;   /* parents's stram pipe to/from child */
    int             child_stat;     /* current connections handling */
    int             child_count;    /* total connections handled */
    time_t          child_time;     /* time at connections is 0 */
    struct _child   *child_next;    /* pointer to next child structure */
} child;

void child_make(int listenfd, fd_set *set, int *maxfd);
void child_main(int sockfd);
void child_schedule(int connfd, int listenfd, fd_set *set, int *maxfd);
void child_delete(child *cp, fd_set *set, int enforce);
void child_killall();

#endif
